package com.example.Laboratory.Service.Impl;

import com.example.Laboratory.Entity.Student_competition;
import com.example.Laboratory.Mapper.Student_competitionMapper;
import com.example.Laboratory.Service.Student_competitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Student_competitionServiceImpl implements Student_competitionService {

    @Autowired
    Student_competitionMapper student_competitionMapper;


    //增加学生竞赛信息
    @Override
    public String addStudent_competition(Student_competition s) {
        if (student_competitionMapper.addStudent_competition(s) == 1) {
            return "添加成功";
        } else {
            return "添加失败";
        }
    }


    //根据id删除学生竞赛信息
    @Override
    public String deleteStudent_competition(int student_competition_id) {
        if (student_competitionMapper.deleteStudent_competition(student_competition_id) == 1) {
            return "删除成功";
        } else {
            return "删除失败";
        }
    }


    //查找学生竞赛信息
    @Override
    public List<Student_competition> researchStudent_competition() {
        return student_competitionMapper.researchStudent_competition();
    }


    //修改学生竞赛信息
    @Override
    public String reviseStudent_competition(Student_competition s) {
        if (student_competitionMapper.reviseStudent_competition(s) == 1) {
            return "修改成功";
        } else {
            return "修改失败";
        }
    }
}
